package com.smasher.component.activity

import android.util.Log
import com.smasher.domain.activity.DomainActivity
import com.smasher.domain.entity.BeanDomain
import com.smasher.net.help.Confucius
import com.smasher.net.help.TokenManager
import com.smasher.net.http.HttpUtil

/**
 * @author HXZ_Android
 */
class DomainTest : DomainActivity() {
    override fun configFileName(): String {
        return "domain.json"
    }

    override fun onDomainChange(domain: BeanDomain) {
        Log.d(TAG, "onDomainChange: $domain")

        Confucius.init(domain.scheme, domain.host, domain.port)
        HttpUtil.getInstance().update()
        TokenManager.instance.saveToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjg4NzU0NTc5NTg1MzcyMTYwIiwiZXhwIjoxNzQ0OTY4NDc5fQ.SufD4252EahHW0VPf7fUyAc23jRmGQ-feutSrv2uL1c")
    }
}
